﻿using KKU.RBSFPP.Shared.Engines;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KKU.RBSFPP.Shared.DAC
{
    public partial class Member : IDataAccessLayer { }
    public partial class PrivilegeLevel : IDataAccessLayer { }
    public partial class Category : IDataAccessLayer { }
    public partial class ProductUnit : IDataAccessLayer { }
    public partial class ProductPricingPerUnit : IDataAccessLayer
    {
        public string BuyDisplay
        {
            get
            {
                return string.Format("{0:#,###}", PurchasingPrice);
            }
        }
        public string SellDisplay
        {
            get
            {
                return string.Format("{0:#,###}", SellingPrice);
            }
        }

        partial void OnSellingPriceChanged()
        {
            setName();
        }

        partial void OnPurchasingPriceChanged()
        {
            setName();   
        }

        private void setName()
        {
            this.Name = string.Format("ซื้อ: {0:C2}, ขาย: {1:C2}", PurchasingPrice, SellingPrice);
        }
    }
    public partial class Product : IDataAccessLayer { }
    public partial class ProductTracking : IDataAccessLayer { }
}
